home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / msdos / ati15khz.h < prev    next >
Text File  |  1999-12-03  |  4KB  |  142 lines

  1. /* for Mach64 and later ATI cards with internal clocks */
  2.  
  3. /* Tested on: */
  4. /* 3D Rage Pro II+, 3D Rage Charger and Xpert@Play */
  5.  
  6. /* CONFIG_CHIP_ID register constants */
  7. #define CFG_CHIP_TYPE        0x0000FFFF
  8. #define CFG_CHIP_CLASS        0x00FF0000
  9. #define CFG_CHIP_REV        0xFF000000
  10. #define CFG_CHIP_VERSION    0x07000000
  11. #define CFG_CHIP_FOUNDRY    0x38000000
  12. #define CFG_CHIP_REVISION    0xC0000000
  13.  
  14. /* Chip IDs read from CONFIG_CHIP_ID */
  15. #define MACH64_GX_ID    0xD7
  16. #define MACH64_CX_ID    0x57
  17. #define MACH64_CT_ID    0x4354
  18. #define MACH64_ET_ID    0x4554
  19. #define MACH64_VT_ID    0x5654
  20. #define MACH64_VU_ID    0x5655
  21. #define MACH64_GT_ID    0x4754
  22. #define MACH64_GU_ID    0x4755
  23. #define MACH64_GP_ID    0x4750
  24. #define MACH64_XP_ID    0x4742
  25. #define MACH64_XP98_ID    0x4c42
  26.  
  27. /* Mach64 chip types */
  28. #define MACH64_UNKNOWN    0
  29. #define MACH64_GX        1
  30. #define MACH64_CX        2
  31. #define MACH64_CT        3
  32. #define MACH64_ET        4
  33. #define MACH64_VT        5
  34. #define MACH64_GT        6
  35.  
  36. /* ATI Bios */
  37. #define    BIOS_DATA_BASE    0xC0000
  38. #define    BIOS_DATA_SIZE    0x8000
  39.  
  40. #define BUS_FIFO_ERR_ACK    0x00200000
  41. #define BUS_HOST_ERR_ACK    0x00800000
  42.  
  43. /* Position of flags in the General Control register */
  44. #define    CRTC_Enable_Doubling            1
  45. #define    CRTC_Enable_Interlace            (1 << 1)
  46. #define    CRTC_FLAG_lock_regs                (1 << 22)
  47. #define    CRTC_FLAG_enable_crtc            (1 << 25)
  48. #define    CRTC_FLAG_extended_display_mode    (1 << 24)
  49.  
  50. /* Sync flags */
  51. #define CRTC_H_SYNC_NEG    0x00200000
  52. #define CRTC_V_SYNC_NEG    0x00200000
  53.  
  54. /* Flags for the General Test register */
  55. #define GEN_OVR_OUTPUT_EN    0x20
  56. #define HWCURSOR_ENABLE        0x80
  57. #define GUI_ENGINE_ENABLE    0x100
  58. #define BLOCK_WRITE_ENABLE    0x200
  59.  
  60. /* PLL registers */
  61. #define PLL_WR_EN        0x02
  62. #define PLL_MACRO_CNTL    0x01
  63. #define PLL_REF_DIV        0x02
  64. #define PLL_GEN_CNTL    0x03
  65. #define MCLK_FB_DIV        0x04
  66. #define PLL_VCLK_CNTL    0x05
  67. #define VCLK_POST_DIV    0x06
  68. #define VCLK0_FB_DIV    0x07
  69. #define VCLK1_FB_DIV    0x08
  70. #define VCLK2_FB_DIV    0x09
  71. #define VCLK3_FB_DIV    0x0A
  72. #define PLL_XCLK_CNTL    0x0B
  73. #define PLL_TEST_CTRL    0x0E
  74. #define PLL_TEST_COUNT    0x0F
  75.  
  76. /* MEM_CNTL register constants */
  77. #define MEM_SIZE_ALIAS        0x00000007
  78. #define MEM_SIZE_512K        0x00000000
  79. #define MEM_SIZE_1M            0x00000001
  80. #define MEM_SIZE_2M            0x00000002
  81. #define MEM_SIZE_4M            0x00000003
  82. #define MEM_SIZE_6M            0x00000004
  83. #define MEM_SIZE_8M            0x00000005
  84. #define MEM_SIZE_ALIAS_GTB    0x0000000F
  85. #define MEM_SIZE_2M_GTB        0x00000003
  86. #define MEM_SIZE_4M_GTB        0x00000007
  87. #define MEM_SIZE_6M_GTB        0x00000009
  88. #define MEM_SIZE_8M_GTB        0x0000000B
  89. #define MEM_BNDRY            0x00030000
  90. #define MEM_BNDRY_0K        0x00000000
  91. #define MEM_BNDRY_256K        0x00010000
  92. #define MEM_BNDRY_512K        0x00020000
  93. #define MEM_BNDRY_1M        0x00030000
  94. #define MEM_BNDRY_EN        0x00040000
  95.  
  96. /* DSP_CONFIG register constants */
  97. #define DSP_XCLKS_PER_QW    0x00003fff
  98. #define DSP_LOOP_LATENCY    0x000f0000
  99. #define DSP_PRECISION        0x00700000
  100.  
  101. /* DSP_ON_OFF register constants */
  102. #define DSP_OFF    0x000007ff
  103. #define DSP_ON    0x07ff0000
  104.  
  105. /* CONFIG_STAT0 register constants (CT, ET, VT) */
  106. #define CFG_MEM_TYPE_xT    0x00000007
  107.  
  108. /* Memory types for CT, ET, VT, GT */
  109. #define DRAM        1
  110. #define EDO_DRAM    2
  111. #define PSEUDO_EDO    3
  112. #define SDRAM        4
  113. #define SGRAM        5
  114.  
  115. /* type of clock */
  116. #define CLK_ATI18818_0    0
  117. #define CLK_ATI18818_1    1
  118. #define CLK_STG1703        2
  119. #define CLK_CH8398        3
  120. #define CLK_INTERNAL    4
  121. #define CLK_ATT20C408    5
  122. #define CLK_IBMRGB514    6
  123.  
  124. /* bit in clock register for strobing */
  125. #define CLOCK_STROBE    0x40
  126.  
  127. /* our 4 driver functions */
  128. int detectati(void);
  129. int widthati15KHz(int width);
  130. int setati15KHz(int vdouble,int width,int height);
  131. void resetati15KHz(void);
  132.  
  133. /* internal functions */
  134. int calc_mach64_scanline(int *nHzTotal,int *nHzDispTotal,int *nHzSyncOffset,int *N,int *P,int *externaldiv,int *nActualMHz);
  135. int calc_mach64_height(int vdouble,int *nOffSet,int *interlace,int *dispdouble,int *vTotal,int *nVSyncOffset,int *nlastline);
  136. int calc_mach64_clock(int nTargetMHz,int *N,int *P,int *externaldiv);
  137. int get_mach64_port(int io_type, int io_base, int io_sel, int mm_sel);
  138. /* DSP */
  139. int setmach64DSP(int nAdd);
  140. void resetmach64DSP(void);
  141.  
  142.